package com.ph.seata.storage.mapper;

import com.ph.seata.storage.model.StorageDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author swallow
 * @since 2021-06-29
 */
public interface StorageMapper extends BaseMapper<StorageDO> {

    /**
     * 扣减商品库存
     * @Param: commodityCode 商品code  count扣减数量
     * @Return:
     */
    int decreaseStorage(@Param("commodityCode") String commodityCode, @Param("count") Integer count);

    /**
     * 根据id查询
     * @param id id
     * @Return:
     */
    StorageDO loadById(Integer id);

}
